home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 June
/
PCWorld_2001-06_cd.bin
/
Novinky
/
unis
/
Soubory ExcelDB.exe
/
ExcelDB
/
Seçity
/
SQLSERVERMAKRO2.bas
< prev
next >
Wrap
BASIC Source File
|
2001-04-24
|
2KB
|
36 lines
Attribute VB_Name = "Module2"
Sub Makro2()
Attribute Makro2.VB_Description = "Makro zaznamenanΘ 13.4.2001, Pokorn²"
Attribute Makro2.VB_ProcData.VB_Invoke_Func = " \n14"
'
' Makro2 Makro
' Makro zaznamenanΘ 13.4.2001, Pokorn²
'
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=SQL Server - Publikace;Description=Zdroj dat pro p°φstup k databßzi PUBS;SERVER=(local);UID=sa;PWD=;WSID=X8J5U8;DATABASE=pu" _
), Array( _
"bs;LANGUAGE=us_english;OemToAnsi=Yes;TranslationDLL=Yes;QueryLogTime=Yes")), _
Destination:=Range("A11"))
.CommandText = Array( _
"SELECT titleview.au_lname, authors.au_fname, titleview.title, titleview.au_ord, authors.address, authors.city, titleview.price, authors.zip, authors.state, titleview.ytd_sales, titleview.pub_id, publi" _
, _
"shers.pub_name" & Chr(13) & "" & Chr(10) & "FROM pubs.dbo.authors authors, pubs.dbo.publishers publishers, pubs.dbo.titleview titleview" & Chr(13) & "" & Chr(10) & "WHERE publishers.pub_id = titleview.pub_id AND authors.au_lname = titleview.au_lname" & Chr(13) & "" & Chr(10) & "ORDER" _
, " BY titleview.au_lname, authors.au_fname")
.Name = "Dotaz z SQL Server - Publikace"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub